import asyncio

from pyxxl import ExecutorConfig, PyxxlRunner

config = ExecutorConfig(
    xxl_admin_baseurl="http://43.156.247.50:8080/xxl-job-admin/api/",
    executor_app_name="house-executor",
    executor_host="43.156.247.50",
)

app = PyxxlRunner(config)


# @app.handler.register(name="fangHandler")
# async def test_task():
#     await asyncio.sleep(5)
#     return "成功..."

# 如果你代码里面没有实现全异步，请使用同步函数，不然会阻塞其他任务
@app.handler.register(name="fangHandler")
def test_task3():
    return "成功3"


app.run_executor()
